package com.design.动态代理;

import java.lang.reflect.Proxy;

/**
 * @author: sun.hongliang
 * @create: 2019/08/16 11:26
 */
public class Main {
    public static void main(String[] args) {
        Hello hello = new HelloImp();
        Hello o = (Hello) Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(),
                new Class[]{Hello.class},
                new DynamicHandler<>(hello));
        String say = o.say();
        System.out.println(say);
    }
}
